Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gml 1809 feedback analysis access control #256

Merged
merged 15 commits into from
Aug 2, 2024

Conversation

luzhoutg
Copy link
Contributor

@luzhoutg luzhoutg commented Jul 31, 2024

  1. update feedback analytics notebook with get_feedback endpoint
  2. add access control
  3. add test cases
  4. update the loadConfig to load multiple config files

if tgcloud {
requestURL = fmt.Sprintf("%s:443/gsqlserver/gsql/file", host)
} else {
requestURL = fmt.Sprintf("%s:14240/gsqlserver/gsql/file", host)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For on-prem DBs, the port is not always 14240. Could we read it from config? How are we handling it for copilot?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. Just push the updated. For CoPilot, pyTG have handled it already.

@luzhoutg luzhoutg requested a review from billshitg August 1, 2024 00:04
Copy link
Contributor

@RobRossmiller-TG RobRossmiller-TG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Tests could do with a negative test (i.e. user is only allowed to see their messages, not all)
  • One quirk in LoadConfig

Otherwise, looks good!

b, err = os.ReadFile(path)
if err != nil {

if err := json.Unmarshal(b, &cfg); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're reading multiple config files, won't cfg just be the last file that was parsed in the list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I update the loadConfig to load multiple config file in to different config structs. i.e., ChatDbConfig, and TgDbConfig. It looks like this: router.HandleFunc("GET /get_feedback", routes.GetFeedback(cfg.TgDbConfig.Hostname, cfg.TgDbConfig.GsPort, cfg.ChatDbConfig.ConversationAccessRoles, cfg.TgDbConfig.TgCloud))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also added test cases for non-admin users and non-existent users.

@luzhoutg luzhoutg merged commit 9b920dc into dev Aug 2, 2024
1 check passed
@luzhoutg luzhoutg deleted the GML-1809-feedback-analysis-access-control branch August 2, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants